You are here: Custom Study Programming > Reference > Classes > StudyData > StudyData Methods > update

update

The update method updates the value at a given index. The index value must be within a valid range of available data points inside StudyData, otherwise update fails.

 

Syntax

update(index, floatValue);

Parameters

index

Index specifies the location where to update the floating value.

 

floatValue

Floating value that will be updated.

Example

function calculate(beginIndex, endIndex)

{

var studyData = this.getStudyData("customSMA");

if(studyData != null)

{

//update last value, and set it to 0.00

if(studyData.count() > 0)

{

studyData.update(studyData.count(), 0.00);

}

}

}

 


Copyright © 2006-2009 ActiveTick LLC